{include file="common/mini-header" title="curd"}


<fieldset class="layui-elem-field layui-field-title" style="margin-top: 30px;">
	<legend>列表</legend>
</fieldset>
<div style="padding: 30px;">
	{if condition="$step eq 1"}
	<table class="layui-table">
		<colgroup>
			<col>
			<col>
			<col width="150">
		</colgroup>
		<thead>
			<tr>
				<th>文件</th>
			</tr>
		</thead>
		<tbody>
			{volist name="$list" id="item"}
			<tr>
				<td> {$item['savefile']}</td>
			</tr>
			{/volist}
		</tbody>
	</table>
	<div><a href="?step=2&name={$_GET['name']}" class="layui-btn layui-btn-normal">确定生成</a> <a href="javascript:history.go(-1);">取消</a>
	</div>
	{elseif condition="$step eq 2" /}
	{if condition="$exists and !$force"}
	<table class="layui-table">
		<colgroup>
			<col>
			<col>
			<col width="150">
		</colgroup>
		<thead>
			<tr>
				<th>文件</th>
			</tr>
		</thead>
		<tbody>
			{volist name="$exists" id="item"}
			<tr>
				<td> {$item} 已存在 <i class="layui-icon layui-icon-close" style="color: red;"></i></td>
			</tr>
			{/volist}
		</tbody>
	</table>
	<div><a href="?force=1&step=2&name={$_GET['name']}" class="layui-btn layui-btn-normal">覆盖</a> <a href="javascript:history.go(-1);">取消</a>
	</div>
	{else /}
	<div>执行完成!</div>
	<div><a href="javascript:" id="closeBtn" class="layui-btn layui-btn-normal">确定</a></div>
	{/if}
	{/if}
</div>

<script>
	layui.use(['layer', 'form'], function () {
		var layer = layui.layer;
		var $ = layui.jquery;
		var form = layui.form;

		$(document).on('click', '#closeBtn', function () {
			window.parent.location.reload();
			var index = parent.layer.getFrameIndex(window.name);
			parent.layer.close(index);
		})
	});
</script>
{include file="common/footer"}